import request from '@/utils/request'

// 查询我的习惯列表
export function listBasic(query) {
  return request({
    url: '/fitness/basic/list',
    method: 'get',
    params: query
  })
}

// 查询我的习惯详细
export function getBasic(basicId) {
  return request({
    url: '/fitness/basic/' + basicId,
    method: 'get'
  })
}

// 新增我的习惯
export function addBasic(data) {
  return request({
    url: '/fitness/basic',
    method: 'post',
    data: data
  })
}

// 修改我的习惯
export function updateBasic(data) {
  return request({
    url: '/fitness/basic',
    method: 'put',
    data: data
  })
}

// 删除我的习惯
export function delBasic(basicId) {
  return request({
    url: '/fitness/basic/' + basicId,
    method: 'delete'
  })
}

// 查询我的习惯字典值
export function dictBasic() {
  return request({
    url: '/fitness/basic/dict',
    method: 'get'
  })
}

// 查询我的习惯树
export function treeBasic() {
  return request({
    url: '/fitness/basic/tree',
    method: 'get'
  })
}

// 导入默认习惯
export function importBasic() {
  return request({
    url: '/fitness/basic/import',
    method: 'get'
  })
}
